package edu.gdkm.demo5;



public class DemoTest3 {
    public static void main(String[] args) {
        Confirm c = new Confirm();
        //向上转型
        Person t= new Teacher();
        c.check(t);
        Person s= new Student();
        c.check(s);
        Person ss =new Staff();
        c.check(ss);

        //向下转型
        Teacher tt=(Teacher)t;
        System.out.println(tt.getCourse());
        //向上转型,向下转型
        Object o =new Teacher();
        Teacher ttt= (Teacher)o;

    }

}
